package com.chance.cc.crawler.development.command.publish.vm;

import com.chance.cc.crawler.core.CrawlerJob;
import com.chance.cc.crawler.development.command.job.domain.vm.xcar.realtime.XcarWebAikahaoRealtimeCrawlerSchedulerJob;
import com.chance.cc.crawler.development.command.job.domain.vm.xcar.simple.XcarWebAikahaoCoreSimple1CrawlerSchedulerJob;
import com.chance.cc.crawler.development.command.job.domain.vm.xcar.simple.XcarWebAikahaoCoreSimple2CrawlerSchedulerJob;
import com.chance.cc.crawler.development.command.job.domain.vm.xcar.simple.XcarWebAikahaoSimpleCrawlerSchedulerJob;
import com.chance.cc.crawler.development.command.job.domain.vm.xcar.trace.XcarWebAikahaoTraceCrawlerSchedulerJob;
import com.chance.cc.crawler.development.command.trigger.domain.vm.realtime.RealtimeCronCrawlerTriggerInfo;
import com.chance.cc.crawler.development.command.trigger.domain.vm.realtime.RealtimeSimpleCrawlerTriggerInfo;
import com.chance.cc.crawler.development.command.trigger.domain.vm.trace.TraceCronCrawlerTriggerInfo;

/**
 * @Author Zhao.Hhuan
 * @Date Create in 2021/3/8 16:15
 * @Description
 *      爱卡汽车
 **/
public class PublishXcarCrawlerJob {
    private static final String domain = "xcar";

    public static void main(String[] args) {
//        publishAikahaoSimpleJob();
        publishAikahaoSimple1Job();
        publishAikahaoSimple2Job();



//        publishAikahaoRealtimeJob();
//        publishAikahaoTraceJob();
//        XcarPublishScript.publishCrawlerNodeScript();
    }

    /**
     * 爱卡汽车单次调度
     */
    public static void publishAikahaoSimpleJob(){
        String node = "爱卡汽车 爱咖号";
        CrawlerJob crawlerJob = XcarWebAikahaoSimpleCrawlerSchedulerJob.publishCrawlerScheduleJobInfo();
        RealtimeSimpleCrawlerTriggerInfo.simpleCrawlerScheduleTriggerInfo(crawlerJob.generateCrawlerKey(),crawlerJob.generateCrawlerTriggerKey(),domain,node);
    }


    /**
     * 爱卡汽车单次调度
     */
    public static void publishAikahaoSimple1Job(){
        String node = "爱卡汽车 爱咖号";
        CrawlerJob crawlerJob = XcarWebAikahaoCoreSimple1CrawlerSchedulerJob.publishCrawlerScheduleJobInfo();
        RealtimeSimpleCrawlerTriggerInfo.simpleCrawlerScheduleTriggerInfo(crawlerJob.generateCrawlerKey(),crawlerJob.generateCrawlerTriggerKey(),domain,node);
    }
    /**
     * 爱卡汽车单次调度
     */
    public static void publishAikahaoSimple2Job(){
        String node = "爱卡汽车 爱咖号";
        CrawlerJob crawlerJob = XcarWebAikahaoCoreSimple2CrawlerSchedulerJob.publishCrawlerScheduleJobInfo();
        RealtimeSimpleCrawlerTriggerInfo.simpleCrawlerScheduleTriggerInfo(crawlerJob.generateCrawlerKey(),crawlerJob.generateCrawlerTriggerKey(),domain,node);
    }

    /**
     * 爱卡汽车每小时的调度
     */
    public static void publishAikahaoRealtimeJob(){
        String node = "爱卡汽车 爱咖号";
        CrawlerJob crawlerJob = XcarWebAikahaoRealtimeCrawlerSchedulerJob.publishCrawlerScheduleJobInfo();
        RealtimeCronCrawlerTriggerInfo.simpleCrawlerScheduleTriggerInfo(crawlerJob.generateCrawlerKey(),crawlerJob.generateCrawlerTriggerKey(),domain,node);
    }

    /**
     * 爱卡汽车每天回溯的调度
     */
    public static void publishAikahaoTraceJob(){
        String node = "爱卡汽车 爱咖号";
        CrawlerJob crawlerJob = XcarWebAikahaoTraceCrawlerSchedulerJob.publishCrawlerScheduleJobInfo();
        TraceCronCrawlerTriggerInfo.simpleCrawlerScheduleTriggerInfo(crawlerJob.generateCrawlerKey(),crawlerJob.generateCrawlerTriggerKey(),domain,node);
    }
}
